import {
    legacy_createStore as createStore
} from "redux"
let initState = {
    list: [] 
}
let reducer = (state = initState, action) => {
    console.log(action);
    if (action.type == "getList") {
       console.log(action,"aaaaa");
        return {
            ...state,
            list: action.paylaod // 将原来的list赋值为网络请求成功后得数据
        }
    } else {
        return {
            ...state
        }
    }
}

export default createStore(reducer)


// 1 .下载redux react-redux 
// 创建stroe文件夹，在store下创建index.js 
// 2. 用Provider标签包裹住所有的组件 <>
